import service from '@/utils/request';

// 获取车辆所有一级和二级分类
export function GetAllCarCate() {
  return service.request({
    method: 'get',
    url: '/CarCategory/findCarCategoryAll',
  })
}
// 获取车辆分类
export function GetCarCate() {
  return service.request({
    method: 'get',
    url: '/CarCategory/selectCarCategoryAll',
  })
}
// 获取二级车辆分类
export function GetAllTwoCate() {
  return service.request({
    method: 'get',
    url: '/categoryTwoController/selectCategorytwoAll',
  })
}
// 获取二级车辆分类通过一级分类Id
export function GetTwoCateById(data) {
  return service.request({
    method: 'get',
    url: '/categoryTwoController/selectCategorytwo?categoryId='+data.categoryId,
  })
}
// 根据一级分类获取二级分类
export function GetTwoCateByfirst(data) {
  return service.request({
    method: 'get',
    url: '/CarCategory/selectCategorytwoById?categoryId='+data,
  })
} 
// 根据二级分类获取车辆信息
export function GetCarsByCate(data) {
  return service.request({
    method: 'get',
    url: '/CarCategorytwo/selectCarById?categoryTwoId='+data,
  })
} 

// 增加车辆二级分类
export function AddCarTwoCate(data) {
  return service.request({
    method: 'post',
    url: '/CarCategorytwo/insertCarCategorytwo',
    data
  })
}
// 删除车辆二级分类
export function DelCarTwoCate(data) {
  return service.request({
    method: 'get',
    url: '/CarCategorytwo/deleteCarCategoryById?categoryTwoId='+data,
  })
}
// 修改车辆二级分类
export function EditCarTwoCate(data) {
  return service.request({
    method: 'post',
    url: '/CarCategorytwo/updateCarCategoryById',
    data
  })
}

// 增加车辆一级分类
export function AddCarFirstCate(data) {
  return service.request({
    method: 'post',
    url: '/CarCategory/insertCarCategory',
    data
  })
}
// 删除车辆一级分类
export function DelCarFirstCate(data) {
  return service.request({
    method: 'get',
    url: '/CarCategory/deleteCarCategoryById?categoryId='+data,
  })
}
// 修改车辆一级分类
export function EditCarFirstCate(data) {
  return service.request({
    method: 'post',
    url: '/CarCategory/updateCarCategoryById',
    data
  })
}
// 搜索车辆分类
export function SearchProdCate(data) {
  return service.request({
    method: 'get',
    url: '/prodcategory/selectByName?categoryName='+data.categoryName+'&categoryNumber='+data.categoryNumber,
  })
}


// 增加车辆信息
export function AddCarInfo(data) {
  return service.request({
    method: 'post',
    url: '/car/insertCarCategorytwo',
    data
  })
}
// 删除车辆信息
export function DelCarInfo(data) {
  return service.request({
    method: 'get',
    url: '/car/deleteCarCategoryById?carId='+data,
  })
}
// 获取车辆信息
export function GetAllCar() {
  return service.request({
    method: 'get',
    url: '/car/selectCarAll',
  })
}
// 修改车辆信息
export function UpdateCarInfo(data) {
  return service.request({
    method: 'post',
    url: '/car/updateCarCategoryById',
    data
  })
}
// 更据牌照查找车辆信息
export function SelectByCar(data) {
  return service.request({
    method: 'get',
    url: '/car/selectCarByName?carNumber='+data.carNumber
  })
}

// 给车辆添加装备
export function addProdFromCar(data) {
  return service.request({
    method: 'post',
    url: '/car/submitAddCarprod',
    data
  })
}
// 给车辆卸载装备
export function delProdFromCar(data) {
  return service.request({
    method: 'post',
    url: '/car/unloadDeleteCarprod',
    data
  })
}
// 给车辆Id查询装备
export function GetCarProdById(data) {
  return service.request({
    method: 'get',
    url: '/car/selectCarprodByCarid?carId='+data,
  })
}
// 添加装备时选择详情
export function GetStockDetailByStockId(data) {
  return service.request({
    method: 'post',
    url: '/Stockdetails/getStockDetailsByStockId',
    data
  })
}
// 删除装备时选择详情
export function GetDetailBycarprodId(data) {
  return service.request({
    method: 'post',
    url: '/car/getCarprodDetailsByCarprodId',
    data
  })
}
